/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kurvykurvy.page;

import com.kurvykurvy.image.LoadedImage;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;

/**
 *
 * @author HY
 */
public class ImageFrameTemplate
        implements ImageFrame
{
    private String ID;
    private Point offset;
    private Dimension size;

    public ImageFrameTemplate( int x, int y, int width, int height )
    {
        offset = new Point( x, y );
        size = new Dimension( width, height );
    }

    public ImageFrameTemplate( Point upperLeft, Point lowerRight )
    {
        setCorners( upperLeft, lowerRight );
    }

    public void setCorners( Point upperLeft, Point lowerRight )
    {
        setOffset( new Point( upperLeft.x, upperLeft.y ) );
        setSize( new Dimension( lowerRight.x - upperLeft.x, lowerRight.y - upperLeft.y ) );
    }

    public void setOffset( Point offset )
    {
        this.offset = offset;
    }

    public Point getOffset()
    {
        return this.offset;
    }

    public Dimension getSize()
    {
        return size;
    }

    public void setSize( Dimension size )
    {
        this.size = size;
    }

    public BufferedImage getImage()
    {
        throw new UnsupportedOperationException( "This is a template only" );
    }

    public void setID( String ID )
    {
        this.ID = ID;
    }

    public String getID()
    {
        return this.ID;
    }

    public void setLoadedImage( LoadedImage img )
    {
        throw new UnsupportedOperationException( "Not supported." );
    }

    public LoadedImage getLoadedImage()
    {
        throw new UnsupportedOperationException( "Not supported." );
    }

    @Override
    public Object clone()
    {
        Object result = new ImageFrameTemplate( this.offset.x, this.offset.y, this.size.width, this.size.height );
        ( (ImageFrameTemplate) result ).setID( getID() );
        return result;
    }

    public void applyTransformation( AffineTransform transform )
    {
        throw new UnsupportedOperationException( "Not supported yet." );
    }

    public AffineTransform getTransformation()
    {
        throw new UnsupportedOperationException( "Not supported yet." );
    }

    public void resetTransformations()
    {
        throw new UnsupportedOperationException( "Not supported yet." );
    }

    public boolean hasTransformations()
    {
        throw new UnsupportedOperationException( "Not supported yet." );
    }
}
